package main

import (
	"fmt"
	"io/fs"
	"os"
)

func main() {
	fi, _ := os.Lstat("fileMode.go")

	fmt.Printf("permissions:%#o\n", fi.Mode().Perm())
	switch mode := fi.Mode(); {
	case mode.IsRegular():
		fmt.Println("regular file")
	case mode.IsDir():
		fmt.Println("directory")
	case mode&fs.ModeSymlink != 0:
		fmt.Println("symbolic link")
	case mode&fs.ModeNamedPipe != 0:
		fmt.Println("named pipe")
	}
}
